package cn.zucc.edu.handyzucc.service.impl;

import cn.zucc.edu.handyzucc.dao.NoticeDao;
import cn.zucc.edu.handyzucc.entity.Notice;
import cn.zucc.edu.handyzucc.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoticeServiceImpl implements NoticeService {
    @Autowired
    private NoticeDao noticeDao;

    @Override
    public List<Notice> getNotices() {
        return noticeDao.getNotices();
    }

    @Override
    public List<Notice> getNoticesByKeyword(String keyword) {
        return noticeDao.getNoticesByKeyword(keyword);
    }

    @Override
    public boolean deleteNotice(Integer notice_id) {
        return noticeDao.deleteNotice(notice_id) == 1;
    }

    @Override
    public boolean addNotice(Notice notice) {
        return noticeDao.addNotice(notice) == 1;
    }

    @Override
    public boolean updateNotice(Notice notice) {
        return noticeDao.updateNotice(notice) == 1;
    }
}
